import Vue from 'vue'
import Router from 'vue-router'
import Index from "./views/Index";
import Post from "./views/index/Post";
import Cost from "./views/index/Cost";
import Income from "./views/index/Income";
import Graph from "./views/index/Graph";
import LineCost from "./views/index/graph/LineCost";
import LineIncome from "./views/index/graph/LineIncome";
import PieCost from "./views/index/graph/PieCost";
import PieIncome from "./views/index/graph/PieIncome";
import BarCompare from "./views/index/graph/BarCompare";
import LineProfit from "./views/index/graph/LineProfit";
import Zone from "./views/Zone";
import Info from "./views/zone/Info";
import Options from "./views/zone/Options";
import Level from "./views/zone/Level";
import PostDetail from "./views/index/PostDetail";
import PostEdit from "./views/index/PostEdit";
import Home from "./views/index/Home";
import Error from "./views/Error";
import Message from "@/views/zone/Message";

Vue.use(Router);
export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [{
        path: "/zone",
        name: "zone",
        component: Zone,
        meta: {
            loginRequire: true
        },
        children: [{
            path: 'info',
            name: 'zone/info',
            component: Info
        },{
            path: 'message',
            name: 'zone/message',
            component: Message
        },{
            path: 'level',
            name: 'zone/level',
            component: Level
        },{
            path: 'options',
            name: 'zone/options',
            component: Options
        }]
    },{
        path: "/",
        name: "index",
        component: Index,

        children: [{
            path: 'home',
            name: "home",
            component: Home
        },{
            path: 'post',
            name: "post",
            component: Post
        },{
            path: 'post/detail',
            name: "post/detail",
            component: PostDetail
        },{
            path: 'post/add',
            name: "post/add",
            component: PostEdit,
            meta: {
                loginRequire: true
            },
        },{
            path: 'post/edit',
            name: "post/edit",
            component: PostEdit,
            meta: {
                loginRequire: true
            },
        },{
            path: 'cost',
            name: 'cost',
            component: Cost,
            meta: {
                loginRequire: true
            },
        },{
            path: 'income',
            name: 'income',
            component: Income,
            meta: {
                loginRequire: true
            },
        },{
            path: 'graph',
            name: 'graph',
            component: Graph,
            meta: {
                loginRequire: true
            },
            children: [{
                path: 'line-cost',
                name: 'graph/line-cost',
                component: LineCost
            }, {
                path: 'line-income',
                name: 'graph/line-income',
                component: LineIncome
            }, {
                path: 'pie-cost',
                name: 'graph/pie-cost',
                component: PieCost
            }, {
                path: 'pie-income',
                name: 'graph/pie-income',
                component: PieIncome
            }, {
                path: 'bar-compare',
                name: 'graph/bar-compare',
                component: BarCompare
            }, {
                path: 'line-profit',
                name: 'graph/line-profit',
                component: LineProfit
            }, ]
        }]
    }, {
        path: "/error",
        name: "error",
        component: Error
    }]
})